package com.rz.htk.dubbo.service;

import consumer.ConsumerInfoService;
import consumer.model.Consumer;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsumerService {

    @Reference(version = "1.0.0", url = "dubbo://127.0.0.1:12345")
    private ConsumerInfoService consumerInfoService;

    public Consumer getById(Integer adminId){
        return this.consumerInfoService.getById(adminId);
    }

    public List<Consumer> getByIds(List<Integer> adminIds){
        return this.consumerInfoService.getByIds(adminIds);
    }

    /**
     * 获取指定用户的子孙级用户id列表（不包含自身id）
     * @param id
     * @return
     */
    public List<Integer> getChildrenIds(Integer id){
        return this.consumerInfoService.getChildrenIds(id);
    }

    /**
     * 获取指定用户的子孙级用户列表（不包含自身）
     * @param id
     * @return
     */
    public List<Consumer> getChildren(Integer id){
        return this.consumerInfoService.getChildren(id);
    }
}
